﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ui="using:Microsoft.Advertising.Mobile.UI"
    xmlns:converters="using:Repeater.Converters"
    x:Class="Repeater.MainPage"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.Resources>
        <converters:RepeatModeToStringConverter x:Key="RepeatModeToStringConverter"/>
    </Page.Resources>
    <Canvas Name="MainCanvas">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="60"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <ui:AdControl Grid.Row="0" 
                          AutoRefreshIntervalInSeconds="60"
                          ApplicationId="703c102e-1e4a-4c64-a841-645f244ed56d" 
                          AdUnitId="201290" 
                          IsAutoRefreshEnabled="True"
                          VerticalAlignment="Top" 
                          Height="50"  Width="320"/>
            <TextBlock Grid.Row="1" Margin="0,5,0,0" FontSize="48" HorizontalAlignment="Center">
                <Run Text="Parrot"/>
            </TextBlock>
            <StackPanel Grid.Row="2" Margin="0,0,0,0">
                <StackPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="326"/>
                        <Setter Property="HorizontalAlignment" Value="Center"/>
                    </Style>
                </StackPanel.Resources>
                <Button Name="BtnOpenFile" Content="Open File"/>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <TextBlock FontSize="18" VerticalAlignment="Center" Width="120">Repeat Mode</TextBlock>
                    <ComboBox ItemsSource="{Binding AllRepeatModes}" 
                          SelectedItem="{Binding CurrentRepeatMode, Converter={StaticResource RepeatModeToStringConverter}, Mode=TwoWay}"
                          Width ="206"></ComboBox>
                </StackPanel>
                <Button Name="BtnPlay"  Content="Play"/>
                <Button Name="BtnBackRepeat" Content="Go Back to Repeat"/>
                <Button Name="BtnStopRepeat" Content="Stop Repeating"/>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Name="BtnGoBack" Content="&lt;&lt;" Width="163"/>
                    <Button Name="BtnGoForward" Content="&gt;&gt;" Width="163"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Name="BtnBeginning" Content="||&lt;&lt;" Width="108"/>
                    <Button Name="BtnPrev" Content="|&lt;&lt;" Width="108"/>
                    <Button Name="BtnNext" Content="&gt;&gt;|" Width="108"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <TextBlock Text="{Binding PlayTime}" Width="40">00:00:00</TextBlock>
                    <Slider Name="PlaySlider"
                        Margin="0"
                        Height="30" Width="300"
                        Minimum="0"
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Center"
                        />
                    <TextBlock Text="{Binding RemainingTime}" Width="40">00:00:00</TextBlock>
                </StackPanel>
                <TextBlock Margin="0,10,0,0" Text="{Binding PickedTrack}" HorizontalAlignment="Center"
                         TextWrapping="Wrap"/>
                <ListBox Name="LstMessages" HorizontalAlignment="Center" Width="300" Background="DarkBlue" 
                         Foreground="White">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="MaxHeight" Value="30"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
            </StackPanel>
        </Grid>
        <Rectangle Name="Bar" Fill="Red" Visibility="Collapsed"></Rectangle>
    </Canvas>
</Page>
